package com.fansl.allround.upms.api.feign.factory;

import com.fansl.allround.upms.api.feign.RemoteRegionService;
import com.fansl.allround.upms.api.feign.fallback.RemoteRegionServiceFallbackImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author fansl
 * @Description: RemoteRegionServiceFallbackFactory
 * @date 2020/1/15 15:18
 */
@Component
public class RemoteRegionServiceFallbackFactory implements FallbackFactory<RemoteRegionService> {
    @Override
    public RemoteRegionService create(Throwable throwable) {
        RemoteRegionServiceFallbackImpl fallback = new RemoteRegionServiceFallbackImpl();
        fallback.setCause(throwable);
        return fallback;
    }
}
